package com.xiangyi.teachingsystem.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiangyi.teachingsystem.dao.PrivateResMapper;
import com.xiangyi.teachingsystem.entity.po.GroupRes;
import com.xiangyi.teachingsystem.entity.po.PrivateRes;
import com.xiangyi.teachingsystem.service.PrivateResService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PrivateResServiceImpl extends ServiceImpl<PrivateResMapper, PrivateRes> implements PrivateResService {
    @Autowired
    PrivateResMapper privateResMapper;
    @Override
    public List<PrivateRes> getPriResList(Integer userId) {
        return privateResMapper.selectList(new QueryWrapper<PrivateRes>()
                .eq("user_id", userId));
    }

    @Override
    public List<PrivateRes> publicResList() {
        return privateResMapper.publicResList();
    }
}
